package brain;

import java.util.ArrayList;

/**
 * 
 * @author JRVamplew
 *
 */
public class MemoryStorage {
	
	public static ArrayList<ArrayList<String>> WorkingMemory = new ArrayList<ArrayList<String>>();
	public static ArrayList<String> instantMemory = new ArrayList<String>();
	
	private final static int WorkingMemoryArchiveSize = 100;
	
	/**
	 * Store Working Memory
	 * @param eventType
	 * @param subjectName
	 * @param eventData
	 */
	public static void storeData(String eventType, String subjectName, String eventData) {
		instantMemory = new ArrayList<String>();
		instantMemory.add(subjectName);
		instantMemory.add(eventData);
		instantMemory.add(eventType);
		instantMemory.add(DateTime.date());
		instantMemory.add(DateTime.time());
		WorkingMemory.add(instantMemory);
		
		if(WorkingMemory.size() >= WorkingMemoryArchiveSize) {
			archiveWorkingMemory(WorkingMemory);
		}
	}
	
	private static void archiveWorkingMemory(ArrayList<ArrayList<String>> WorkingMemory) {
		//Break down Array Lists into SQL queries using loops
	}
	
	
	
}
